package com.lottery.im.api.result.entity.redpacket;

import android.databinding.BindingAdapter;
import android.text.TextUtils;
import android.util.Log;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.lottery.im.R;
import com.lottery.im.api.Api;
import java.util.List;

/**
 * 作者：cyy
 * 时间：2018/9/25。
 */
public class Type3SQ {

  /**
   * pzwb : 1：修改成功后|2：需要到用户管理/会员总览重新加载下内存参数|3：才可修改成功
   * list : [{"time":"2018-09-24 19:12:54","headImg":"headImg/28.png","jf":"30","name":"码形得码"},
   * {"time":"2018-09-24 19:21:21","headImg":"headImg/12.png","jf":"13","name":"丁用通形"},
   * {"time":"2018-09-24 19:42:55","headImg":"headImg/35.png","jf":"13","name":"类一用改"},
   * {"time":"2018-09-24 19:49:45","headImg":"headImg/10.png","jf":"10","name":"合正形正"}]
   */

  private String pzwb;
  private List<ListBean> list;

  public String getPzwb() {
    if(!TextUtils.isEmpty(pzwb)){
      return pzwb.replaceAll("\\|","\n");
    }else{
      return "";
    }
  }

  public void setPzwb(String pzwb) {
    this.pzwb = pzwb;
  }

  public List<ListBean> getList() {
    return list;
  }

  public void setList(List<ListBean> list) {
    this.list = list;
  }

  public static class ListBean {
    /**
     * time : 2018-09-24 19:12:54
     * headImg : headImg/28.png
     * jf : 30
     * name : 码形得码
     */

    private String time;
    private String headImg;
    private String jf;
    private String name;

    @BindingAdapter({"type3QImageUrl"})
    public static void loadType3QImage(ImageView imageView,String url){
      Glide.with(imageView.getContext())
          .load(Api.BASEADDRESS+url)
          .apply(new RequestOptions()
              .placeholder(R.drawable.icon_conversation_de)
              .error(R.drawable.icon_conversation_de)
              .fitCenter())
          .into(imageView);
    }

    public String getTime() {
      return time;
    }

    public void setTime(String time) {
      this.time = time;
    }

    public String getHeadImg() {
      return headImg;
    }

    public void setHeadImg(String headImg) {
      this.headImg = headImg;
    }

    public String getJf() {
      return jf;
    }

    public void setJf(String jf) {
      this.jf = jf;
    }

    public String getName() {
      return name;
    }

    public void setName(String name) {
      this.name = name;
    }
  }
}
